<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Main-template.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />



<!-- InstanceBeginEditable name="doctitle" -->

<?php
	include_once("admin/lib/ClassSanPham.php");
	include_once("admin/lib/ClassHinh.php");
	
	//Nếu ko truyền id qua
	if(!isset($_REQUEST["id"]))
	{
		header("Location: index.php");
	}
	
	//Nhận id, truy vấn lấy sản phẩm
	$masp = $_REQUEST["id"];
	$sp = SanPham::LaySanPham_ChuaXoa_TheoMa($masp);
	
	//Nếu id ko hợp lệ (tồn tại trong csdl)
	if(!$sp)
	{
		header("Location: index.php");
	}
	


	echo $sp->TenSanPham;
?>
<title>
<?php

	if($sp->TenSanPham != "")
		echo $sp->TenSanPham.' | Quang Du Co';
?>
</title>

<!-- InstanceEndEditable -->

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/product.css"/>
<script type="text/javascript" src="js/products.js"></script>

<!-- InstanceBeginEditable name="CSS" -->
<!-- Resources của Fancybox-->
<link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<!--end Resources của Fancybox-->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="JS" -->
<!-- Resources của Fancybox-->
<script type="text/javascript" src="js/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="js/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<!--end Resources của Fancybox-->
<!-- InstanceEndEditable -->



<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>
<body>

<div class="container">
    <div class="left-nav"><a href="index.php" style="border:0px;"><img src="img/logo_QDC.png" style="padding-bottom:30px;" width="170" height="170"/></a>
        <hr />
        <ul style="font-family:myFont-BaiSau; font-size:20px;">
            <li><a href="index.php">Trang chủ</a></li>
            <li><a href="intro.php">Giới thiệu</a></li>
            <li><a href="products.php">Sản phẩm</a></li>
            <li><a href="contact.php">Liên hệ</a></li>
        </ul>
    </div>
    <div class="content">
        <div class="name">
            <span class="company-name">
            <!-- InstanceBeginEditable name="ProductName" -->
            <?php
				echo $sp->TenSanPham;
            ?>
			<!-- InstanceEndEditable -->
            </span><br/>
            <span class="companu-slogan">
			<!-- InstanceBeginEditable name="ProductInfo" -->
            <?php
				echo $sp->ThongTin;
            ?>
			<!-- InstanceEndEditable -->     
            </span> </div>
        <hr id="clear"/>
        <div class="blank"></div>
        <div id="products">
		<!-- InstanceBeginEditable name="Main content" -->
		
        <?php
		//Lấy danh sách hình theo mã sp
		$dshinh = HinhAnh::LayDanhSachHinh_ChuaXoa_TheoMaSanPham($masp);
		foreach($dshinh as $hinh)
		{
			$urlhinh = $hinh->Url;
			//url truy xuất từ thư mục admin nên có dạng (../img/xx/xxxxx)
			//phải cắt bỏ phần đầu (../) để trở thành dạng (img/xx/xxxxx)
			$urlhinh = substr($urlhinh,3);
				
			echo'
				<div id="products-wraper">
					<div class="img-product-detail">
						<a rel="example_group" href="'.$urlhinh.'" title="QuangDuCo">
							<img id="mainimg" src="'.$urlhinh.'" width="400px" height="300px" />
							<img id="shadow" src="img/shadow.png" />
						</a>
					</div>
				</div>
			';
		}
        ?>
          
		<!-- InstanceEndEditable -->
        </div>
        <div class="blank"></div>
        <hr id="clear" />
        <p id="company-info"> <span style="font-family:myFont-VNI-Avo;text-transform:uppercase;color:#444;font-style:normal;font-weight:bold;line-height:30px;">Quang Du CO</span><br/>
        <span style="font-family:myFont-BaiSau;font-size:15px;color:#555;">
            <span><!-- InstanceBeginEditable name="Phone" -->
			<?php
				include_once("admin/lib/ClassQuanLy.php");
				$ql = QuanLy::LayTatCaThongTin();
        	?>
            Di động : <?php echo $ql->Mobile; ?><!-- InstanceEndEditable --></span><br/>
            <span><!-- InstanceBeginEditable name="Address" -->Địa chỉ : <?php echo $ql->DiaChiCongTy; ?> <!-- InstanceEndEditable --></span><br/>
        </span>
        </p>
        <div class="blank"></div>
    </div>
    <div class="blank" id="black-blank" ></div>
</div>
</body>
<!-- InstanceEnd --></html>
